The present invention relates to an encoding apparatus, a decoding apparatus and their methods for encoding and decoding picture information generated by and used in a facsimile machine, a scanner, and a computer. More specifically, the present invention relates to an encoding apparatus and a decoding apparatus having two types of encoding and decoding systems for efficiently encoding and decoding picture information by switching between the two types of encoding and decoding systems. Further, the present invention relates to an encoding method and a decoding method for encoding and decoding picture information efficiently. The present invention also relates to a picture processing apparatus having an encoding apparatus and a decoding apparatus according to the present invention. The present invention also relates to a picture processing apparatus for implementing an encoding method and a decoding method according to the present invention.
Related Art 1.
FIG. 66 is a block diagram showing a conventional encoding apparatus.
In FIG. 66, reference numeral 901 indicates a picture element memory for receiving, storing, and outputting the value of a picture element to be encoded (which will be referred to as an encoding picture element, or simply as a picture element) and for outputting the value of at least one encoded picture element already stored in the picture element memory and adjacent to the encoding picture element as the value of a reference picture element.
Reference numeral 907 indicates a predictor for calculating the prediction value for the encoding picture element by referring to the value of the at least one reference picture element.
Reference numeral 931 indicates a prediction error calculator for determining the prediction error by subtracting the prediction value calculated by the predictor 907 from the value of the encoding picture element.
Reference numeral 908 indicates an encoder for encoding the prediction error between the value of the encoding picture element and the prediction value calculated by the predictor 907, and for outputting codewords.
Reference numeral 910 indicates a code buffer for receiving the codewords supplied from the encoder 908 and for outputting a sequence of the codewords as a code in order of the received codewords.
Next, an operation of the conventional encoding apparatus is explained.
The predictor 907 calculates the prediction value from the value of the at least one reference picture element. The calculation method may be implemented in accordance with a predetermined prediction function or by referring to a reference table. The encoder 908 encodes the prediction error (xe2x88x92255+255, inclusive of zero, in the case of one picture element being represented by eight bits) which has been obtained by subtracting the calculated prediction value from the value of an encoding picture element by using a predetermined codeword table.
Related Art 2.
As another conventional related art, conversion of the prediction errors for encoding picture elements and picture elements to be decoded into binary symbol sequences, and encoding and decoding the binary symbol sequences are known. As one of the encoding and decoding methods for binary symbols, the encoding and decoding method disclosed in Japanese Patent Registered No. 1251403 will be described herein.
According to this encoding and decoding method, as shown in FIG. 67, one codeword is allotted to a binary symbol sequence composed of one binary symbol or a plurality of binary symbols. The term xe2x80x9cencodingxe2x80x9d is used in this specification to mean an operation for determining and allotting a codeword to a sequence of a certain number (which will be hereinafter referred to as the code order) of binary xe2x80x9c0xe2x80x9d symbols (More Probable Symbols abbreviated to MPSs) or binary xe2x80x9c1xe2x80x9d symbols (Less Probable Symbol abbreviated to LPSs) occurred, and for outputting the codeword therefor. At the time of encoding, the number of MPSs consecutively occurred is counted by an MPS counter (not shown) inside (or outside) the encoder. The counted value of MPSs is stored in an MPS memory (not shown), and the state numbers of binary symbol sequences (to be described hereafter) are stored in a state-number memory (not shown). The code order may be an integer greater than zero. However, it is assumed herein that the code order is restricted to 2n (the n-th power of 2). When the number of MPSs consecutively occurred (the count of the MPS counter) has become equal to the code order 2n, one-bit codeword xe2x80x9c0xe2x80x9d is allotted to the MPSs. On the other hand, when an LPS has occurred before the number of MPSs consecutively occurred becomes equal to the code order, the number of the MPSs consecutively occurred after outputting the latest codeword before occurring the LPS is expressed in terms of n-bit binary symbols, and, in order to differentiate from the sequence of the MPSs to which the codeword xe2x80x9c0xe2x80x9d is allotted, the codeword xe2x80x9c1xe2x80x9d is added to the beginning of the n-bit binary symbols. Accordingly, a codeword of (n+1) bits is allotted to the sequence of MPSs plus the LPS differentiating from the sequence of MPSs to which a codeword of xe2x80x9c0xe2x80x9d is allotted. The unit of a binary symbol sequence to which a codeword is allotted is referred to as a message. After the codeword is determined and output, the MPS counter is reset. A sequence of codewords output in this way constitutes a code. On the other hand, when a code is to be decoded, the code is supplied to the decoder and divided into individual codewords. Then, a binary symbol sequence is recreated by the decoder, and picture elements are reproduced. In this way, decoding is implemented.
In the aforementioned encoding and decoding method, the code order is changed so as to represent the appropriate code length in accordance with the occurrence probability of one of binary symbols estimated from past data on binary symbol sequences. For this reason, a further excellent encoding efficiency can be obtained.
A first example of the state transition method of determining the code order will be described now.
When a binary symbol sequence is encoded or decoded by an encoder or a decoder, the binary symbol sequence belongs to one of the sixteen states shown in FIG. 68. The code order is determined according to the state to which each binary symbol sequence belongs. It is assumed herein that the initial value of the state number for the encoder or the decoder is set to 0. It is also assumed herein that the MPS counter of the encoder or the decoder is reset at the beginning of the encoding process or the decoding process. During the encoding process or the decoding process, the encoder or the decoder implements state transition when a codeword has been determined. When the number of MPSs consecutively occurred in a binary symbol sequence has become equal to the code order of the binary symbol sequence, the state number of the sequence is increased by one. When an LPS has occurred in a binary symbol sequence before the number of MPSs consecutively occurred becomes equal to the code order of the binary symbol sequence, the state number of the sequence is decreased by one. However, when the number of MPSs consecutively occurred in a binary symbol sequence having the state number 15 has become equal to the code order of the binary symbol sequence, or when an LPS has occurred in a binary symbol sequence having the state number 0, the encoder or the decoder does not implement state transition, and the state number remains unchanged.
According to a second example of the method of determining the code order, there is shown a method in which the numbers of binary symbols xe2x80x9c0xe2x80x9d and binary symbols xe2x80x9c1xe2x80x9d which have occurred in a binary symbol sequence, respectively indicated by N(0) and N(1), are counted on both the transmitting side and the receiving side within the same range (such as, for example, within one line) so as to calculate the code order of the binary symbol sequence, based on the result of the count. The method of determining the code order, for example, is disclosed in Japanese Unexamined Patent Publication No. SHO59-27501 (which corresponds to U.S. Pat. No. 4,191,974). The calculation method is expressed by the relation of 2n+1N(1) greater than N(0)∃2nN(1). In this case, however, the code order 2n which varies with state transition of a binary symbol sequence is not less than a predetermined minimum value, nor more than a predetermined maximum value.
It is known that the encoding method shown in FIG. 67 has the following characteristics. Let us assume that a binary information source whose probability of binary symbol xe2x80x9c0xe2x80x9d and whose probability of binary symbol xe2x80x9c1xe2x80x9d are p, 1xe2x88x92p (p ∃xc2xd) respectively are encoded in accordance with the encoding method shown in FIG. 67. When the occurrence of the binary symbols to be encoded may be random, the order n rendering a maximum code length in each code order minimum fulfills the following expression:
{2n/(2n+1)}#p less than {2n+1/(2n+1+1)}
Accordingly, by determining n in accordance with the above expression, a substantially optimum code can be selected.
Assuming that the number of binary symbols xe2x80x9c0xe2x80x9d is N(0) and the number of binary symbols xe2x80x9c1xe2x80x9d is N(1), the probability p is expressed as follows:
p=N(0)/{N(0)+N(1)}
Thus the above expression is reduced to as follows:
2nN(1)#N(0)#2n+1N(1) 
Related Art 3.
Among the conventional encoding apparatuses and the conventional decoding apparatuses, there is an encoding apparatus or a decoding apparatus wherein two encoding or decoding modes such as the mode A and the mode B are provided, for example, and encoding or decoding is implemented by switching between the mode A and the mode B according to the decision whether or not a predetermined condition for the value(s) of reference picture element(s) is satisfied. Basically, if the value(s) of reference picture element(s) satisfies a predetermined condition, encoding or decoding is implemented in the mode A. On the other hand, if the value(s) of reference picture element(s) does not satisfy a predetermined condition, encoding or decoding is implemented in the mode B. Mode switching may be accomplished, for example, in accordance with the method described in xe2x80x9cThe National Assembly 1016 of the Institute of Electronics and Communication Engineers of Japan held in 1977xe2x80x9d as the xe2x80x9crun length encoding process according to the encoding start patternsxe2x80x9d. As shown in FIG. 69, a picture element X is assumed herein to be a picture element to be encoded or decoded (which will be hereinafter simply referred to as a picture element). If the values of reference picture elements a, b, and c adjacent to the picture element X satisfy a predetermined condition xe2x80x9ca=b=cxe2x80x9d, the picture element X and the subsequent picture elements are encoded or decoded continuously in the mode A until the picture element X becomes xe2x80x9cX a prediction valuexe2x80x9d. When the picture element X occurs that does not coincide with the prediction value, the mode A is switched into the mode B. Then, the picture element X and the subsequent picture elements are encoded or decoded continuously in the mode B. When the values of the reference picture elements a, b, and c satisfy the predetermined condition xe2x80x9ca=b=cxe2x80x9d again, the mode is switched to the mode A and the subsequent encoding or decoding picture element is encoded or decoded in the mode A.
Related Art 4.
In the following, encoding process and decoding process of a picture in a conventional picture pick-up apparatus is explained referring to drawings. In this related art, encoding process is performed by a picture compression circuit and decoding process is performed by a picture expansion circuit.
FIG. 70 shows a configuration of the picture compression circuit and the picture expansion circuit.
In FIG. 70, the picture compression circuit includes a process for implementing a lossless compression and another process for implementing a lossy compression.
A lossy picture compression means a compressing process where a compressibility of the picture is increased, though a quality of reproduced picture (reproducibility) is decreased.
On the other hand, a lossless picture compression means a compressing process where the quality of reproduced picture (reproducibility) is not decreased, though a compressibility of the picture is less increased than the above lossy picture compression.
A DCT (Discrete Cosine Transform) circuit 951 performs two-dimensional DCT operation on an input picture to divide the picture into two-dimensional spatial frequency components. A quantization circuit 952 quantizes a DCT coefficient. An entropy encoder 953 implements Huffman coding on the quantized DCT coefficient. The lossy picture compression is performed by the DCT circuit 951, the quantization circuit 952 and the entropy encoder 953. A predictor 954 predicts data of a certain picture element by using data of the previous picture element. An entropy encoder 955 implements Huffman coding of a differential between the picture element and the picture element predicted by the predictor 954. In this way, the lossless data compression is implemented by the predictor 954 and the entropy encoder 955. A switch SW1 selects one of the compressing processes: side xe2x80x9caxe2x80x9d of the lossless compression; and side xe2x80x9cbxe2x80x9d of the lossy compression.
The picture expansion circuit includes a process for implementing a lossless expansion and a process for implementing lossy expansion. An entropy decoder 956 and a decoder 957 decode the reversibly compressed data by an inverse operation of the entropy encoder 955 and the predictor 954. An entropy decoder 958, a dequantization circuit 959 and an inverse DCT circuit 960 decode the compressed data by an inverse operation of the DCT circuit 951, the quantization circuit 952 and the entropy encoder 953. A switch SW2 selects one of the expanding processes: side xe2x80x9caxe2x80x9d of the lossless expansion; and side xe2x80x9cbxe2x80x9d of the lossy expansion.
The conventional encoding apparatus which has been described as the related art 1 encodes a prediction error by referring to a predetermined codeword table. Generally, with regard to the picture information, the statistical characteristic of the picture information displayed on a screen varies greatly depending on the part on the screen. In other words, it is known that it occurs that prediction for some part of the picture information displayed on the screen tends to be correct while other part of the picture information displayed on the screen often has great prediction errors. Although the statistical characteristic of the picture information displayed on the screen varies, the encoding apparatus according to the first conventional related art implements encoding by referring to a single codeword table. Thus, it has created a problem in that an encoding efficiency cannot be enhanced.
On the other hand, the encoding method which has been described as the related art 2 is a method of implementing encoding by referring to a plurality of codeword tables and dynamically changing the code order depending on the occurrence probability of the MPS. Consequently, if the statistical characteristic of picture information displayed varies greatly, a more excellent encoding efficiency will be provided with this encoding system than with the encoding apparatus which has been described as the first conventional related art. However, even by using the encoding method according to related art 2, when at least one codeword is allotted to a prediction error for each encoding picture element, at least one-bit code amount is required for each picture element regardless of whether or not the prediction has proved to be correct (or no prediction error has been produced). Allotting a one-bit or more bits of codeword to a prediction error although the prediction probability exceeds xc2xd means that the actual code amount required is greater than the theoretical minimum code amount (entropy) for the prediction error. In other words, it means that an encoding efficiency is reduced.
According to the aforementioned related art 4, the picture compression circuit (encoding apparatus) and the picture expansion circuit (decoding apparatus) are configured as shown in FIG. 70. The DCT circuit, the quantization circuit and the entropy encoder implement lossy picture compression and lossy picture expansion. On the other hand, the predictor and the entropy encoder implement lossless picture compression and lossless picture expansion. In this way, the conventional picture pick-up apparatus switches the lossless picture compression circuit and the lossy picture compression circuit according to the condition. In the picture pick-up apparatus, it is mostly required to increase the compressibility of the picture without decreasing the quality of the reproduced picture (reproducibility). Particularly, in the art of a digital camera, the above requests have been highly demanded these days so as to store the picked-up signals in the storage medium and to display the picked-up signals on the monitor. Input information of picture has been increasing because of a large number of picture elements of input picture, color input picture, and multiple gradation of input picture. There is a problem that the conventional picture processing apparatus cannot supply enough compressibility of picture in case of storing such information of picture in a limited capacity of the storage medium.
On handling multimedia information, picture information is transmitted, displayed, or stored together with other information such as audio information, or character information. Picture information occupies higher ratio than other information among such multimedia information, and these days it is required that the compressibility of picture is further increased.
The present invention has been made to solve the above-mentioned problems. It is therefore an object of the present invention to provide an encoding apparatus and a decoding apparatus which can implement encoding and decoding picture information efficiently.
Further, it is another object of the present invention to provide an encoding method and a decoding method for encoding and decoding picture information efficiently by actively switching between different types of encoding systems and decoding systems.
It is a further object of the present invention to provide an encoding apparatus and a decoding apparatus which can be produced in a smaller size and constructed easily even when encoding and decoding picture information are to be efficiently implemented by actively switching between different types of encoding systems and decoding systems.
Further, it is also an object of the present invention to provide a picture processing apparatus having the above-mentioned encoding apparatus and the above-mentioned decoding apparatus.
Still further, it is also an object of the present invention to provide a picture processing apparatus for implementing the above-mentioned encoding method and the above-mentioned decoding method.
It is an object of the present invention to provide an picture processing apparatus for implementing a lossless picture compression with higher compressibility than the lossless picture compression implemented by the conventional picture processing apparatus.
An encoding apparatus according to the present invention may comprise:
a picture element memory for receiving and storing a picture element having a value within a predetermined range as an encoding picture element, outputting the value of the encoding picture element, and for outputting a value of an encoded picture element adjacent to the encoding picture element as the value of a reference picture element;
a mode determinator for selecting one of a specific encoding mode and an encoding mode other than the specific encoding mode from a plurality of predefined encoding modes for the encoding picture element based on the value of the reference picture element;
a first encoding section for predicting the value of the encoding picture element, determining whether the prediction is correct, encoding the value of the encoding picture element based on a result of the determination, and for outputting a codeword for the encoding picture element;
a second encoding section for predicting the value of the encoding picture element, encoding the value of the encoding picture element without determining whether the prediction is correct, and for outputting a codeword for the encoding picture element; and
an encoding controller for selectively operating the first encoding section and the second encoding section based on one of the specific encoding mode and the encoding mode other than the specific encoding mode selected by the mode determinator.
The first encoding section may comprise:
a first predictor for calculating a prediction value of the encoding picture element based on the value of the reference picture element;
a first prediction error calculator for calculating an error between the value of the encoding picture element and the prediction value calculated by the first predictor as a prediction error;
a determinator for determinating whether the prediction error calculated by the first prediction error calculator is a specific value, and for outputting a result of the determination;
a first encoder for receiving and encoding the result of the determination output from the determinator, and for outputting the codeword for the encoding picture element to be encoded in the selected specific encoding mode; and
a second encoder for encoding the prediction error calculated by the first prediction error calculator when the prediction error is other than the specific value for the encoding picture element to be encoded in the selected specific encoding mode, and for outputting the codeword for the encoding picture element to be encoded in the selected specific encoding mode.
The second encoding section may comprise:
a second predictor for calculating a prediction value of the encoding picture element based on the value of the reference picture element;
a second prediction error calculator for calculating an error between the value of the encoding picture element and the prediction value calculated by the second predictor as a prediction error; and
a third encoder for encoding the prediction error calculated by the second prediction error calculator for the encoding picture element to be encoded in the selected encoding mode other than the specific encoding mode, regardless of whether the prediction error is the specific value, and for outputting the codeword for the encoding picture element to be encoded in the selected encoding mode other than the specific encoding mode.
The first encoder may comprise a first probability estimator for receiving the result of the determination output from the determinator as a sequence of binary symbols and estimating an occurrence probability of one of the binary symbols, and a first codeword allotter for encoding the sequence of binary symbols, and
the second encoder may comprise a first error-to-symbol converter for receiving the prediction error and converting the prediction error into a sequence of binary symbols, a second probability estimator for receiving the sequence of binary symbols and estimating an occurrence probability of one of the binary symbols, and a second codeword allotter for encoding the sequence of binary symbols, and
the third encoder may comprise a second error-to-symbol converter for receiving the prediction error and converting the prediction error into a sequence of binary symbols, a third probability estimator for receiving the sequence of binary symbols and estimating an occurrence probability of one of the binary symbols, and a third codeword allotter for encoding the sequence of binary symbols.
The encoding controller may have a codeword transmission order controller for changing an order for outputting codewords when a codeword has been determined by at least one of the first encoder, the second encoder, and the third encoder and when a codeword has not been determined by the other encoders.
In the encoding apparatus according to the present invention, at least one of the first error-to-symbol converter and the second error-to-symbol converter successively may generate comparison values starting with a value which would most likely occur as a prediction error to be input to one of the first error-to-symbol converter and the second error-to-symbol converter, may successively compare the generated values with the prediction error input to one of the first error-to-symbol converter and the second error-to-symbol converter one by one, and may generate and output a sequence of binary symbols based on a count of comparison time until one of the generated comparison values coincides with the prediction error.
The mode determinator may select an encoding mode for an encoding picture element based on an encoding mode for an encoded picture element preceding the encoding picture element.
In the encoding apparatus according to the present invention, at least one of the first codeword allotter, the second codeword allotter, and the third codeword allotter may change interpretation as to which one of the binary symbols is a more probable symbol, based on a change in probability estimation for one of the binary symbols respectively implemented by the first probability estimator for the first codeword allotter, the second probability estimator for the second codeword allotter, and the third probability estimator for the third codeword allotter.
The first predictor of the first encoding section and the second predictor of the second encoding section may be combined into a predictor.
At least two encoders of the first encoder, the second encoder, and the third encoder may be combined into an encoder.
In the picture encoding apparatus according to the present invention, based on information as to which one of the binary symbols is a more probable symbol and an estimated occurrence probability of the more probable symbol, at least one of the first codeword allotter, the second codeword allotter, and the third codeword allotter may implement encoding for an enlarged information source of the binary symbols effected by selecting a code most suited to a state of the enlarged information source of the binary symbols assumed from the estimated occurrence probability of the more probable symbol from a Huffman code set prepared systematically for the enlarged information source of the binary symbols.
A decoding apparatus according to the present invention may comprise:
a picture element memory for storing decoded picture elements having values within a predetermined range, and outputting the value of one of the decoded picture elements adjacent to a decoding picture element as a value of a reference picture element;
a mode determinator for selecting one of a specific decoding mode and a decoding mode other than the specific decoding mode from a plurality of predefined decoding modes for the decoding picture element based on the value of the reference picture element;
a first decoding section for receiving a codeword, predicting a value of the decoding picture element, determining whether the prediction is correct, and for decoding the codeword into the value of the decoding picture element based on a result of the determination;
a second decoding section for receiving a codeword for the decoding picture element, predicting the value of the decoding picture element, decoding the codeword into the value of the decoding picture element without determining whether the prediction is correct; and
a decoding controller for selectively operating the first decoding section and the second decoding section based on one of the specific decoding mode and the decoding mode other than the specific decoding mode selected by the mode determinator.
The first decoding section may comprise:
a first predictor for calculating a prediction value of the decoding picture element based on the value of the reference picture element;
a first decoder for decoding the codeword for the decoding picture element to be decoded in the selected specific decoding mode into a result of determination indicating whether a prediction error is predetermined value;
a second decoder for decoding the codeword for the decoding picture element to be decoded in the selected specific decoding mode and having the prediction error other than the predetermined value into the prediction error other than the predetermined value;
a first decoding picture element calculator for calculating the value of the decoding picture element based on the prediction value of the decoding picture element calculated by the first predictor, the result of the determination, and the prediction error obtained by the second decoder.
The second decoding section may comprise:
a second predictor for calculating a prediction value of the decoding picture element based on the value of the reference picture element;
a third decoder for decoding the codeword for the decoding picture element to be decoded in the selected decoding mode other than the specific decoding mode into the prediction error regardless of whether the prediction error is the predetermined value;
a second decoding picture element calculator for calculating the value of the decoding picture element to be decoded in the selected decoding mode other than the specific decoding mode based on the prediction value of the decoding picture element calculated by the second predictor and the prediction error obtained by the third decoder.
The first decoder may have a first symbol restoring device for receiving the codeword and decoding the codeword into a sequence of binary symbols and a first probability estimator for estimating an occurrence probability of one of the binary symbols, and wherein the first decoder outputs one of the binary symbols as a result of determination, and
the second decoder may have a second symbol restoring device for receiving the codeword and decoding the codeword into a sequence of binary symbols, a second probability estimator for receiving the binary symbols and estimating an occurrence probability of one of the binary symbols, and a first symbol-to-error converter for receiving the sequence of binary symbols and converting the sequence of binary symbols into the prediction error, and
the third decoder may have a third symbol restoring device for receiving the codeword and decoding the codeword into a sequence of binary symbols, a third probability estimator for receiving the binary symbols and estimating an occurrence probability of one of the binary symbols, and a second symbol-to-error converter for receiving the sequence of binary symbols and converting the sequence of binary symbols into the prediction error.
The decoding controller may have a binary-symbol sequence using order controller for changing an order of using decoded binary symbols in a case where, before all sequences of binary symbols decoded by at least one of the first decoder, the second decoder, and the third decoder are used up, a sequence of binary symbols is output from the other one of the first decoder, the second decoder, and the third decoder.
In the decoding apparatus according to the present invention, at least one of the first symbol-to-error converter and the second symbol-to-error converter may convert the input sequence of binary symbols into the prediction error based on a value and a number of the binary symbols input.
The mode determinator may select a decoding mode for a decoding picture element based on a decoding mode for a decoded picture element preceding the decoding picture element.
In the decoding apparatus according to the present invention, at least one of the first symbol restoring device, the second symbol restoring device, and the third symbol restoring device may change interpretation as to which one of the binary symbols is a more probable symbol based on a change in probability estimation for the binary symbols respectively implemented by the first probability estimator for the first symbol restoring device, the second probability estimator for the second symbol restoring device and the third probability estimator for the third symbol restoring device.
The first predictor of the first decoding section and the second predictor of the second decoding section may be combined into a predictor.
At least two decoders of the first decoder, the second decoder, and the third decoder may be combined into a decoder.
In the decoding apparatus according to the present invention, based on information as to which one of the binary symbols is a more probable symbol and an estimated occurrence probability of the more probable symbol, at least one of the first symbol restoring device, the second symbol restoring device, and the third symbol restoring device may implement decoding for an enlarged information source of binary symbols effected by selecting a code most suited to a state of the enlarged information source of binary symbols assumed from the estimated occurrence probability of the more probable symbol from a Huffman code set prepared systematically for the enlarged information source of binary symbols.
An encoding method according to the present invention may comprise:
an outputting step of receiving and storing a picture element having a value within a predetermined range as an encoding picture element, outputting the value of the encoding picture element, and outputting a value of an encoded picture element adjacent to the encoding picture element as the value of a reference picture element;
a mode deciding step of selecting one of a specific encoding mode and an encoding mode other than the specific encoding mode from predefined encoding modes for the encoding picture element based on the value of the reference picture element;
a first main encoding step of predicting the value of the encoding picture element, determining whether the prediction is correct, encoding the value of the encoding picture element based on a result of determination, and outputting a codeword for the encoding picture element;
a second main encoding step of predicting the value of the encoding picture element, encoding the value of the encoding picture element without determining whether the prediction is correct, and outputting a codeword for the encoding picture element; and
an encoding controlling step of selectively operating the first main encoding step and the second main encoding step based on the specific encoding mode and the encoding mode other than the specific encoding mode selected by the mode deciding step.
The first main encoding step may comprise:
a first predicting step of calculating a prediction value of the encoding picture element based on the value of the reference picture element;
a first prediction error calculating step of calculating an error between the value of the encoding picture element and the prediction value calculated by the first predicting step as a prediction error;
a determination step of determinating whether the prediction error calculated by the first prediction error calculating step is a predetermined value, and outputting a result of the determination;
a first encoding step of receiving and encoding the result of the determination output by the determination step and outputting the codeword for the encoding picture element to be encoded in the selected specific encoding mode; and
a second encoding step of encoding the prediction error calculated by the first prediction error calculating step when the prediction error is other than the predetermined value for the encoding picture element to be encoded in the selected specific encoding mode, and outputting the codeword for the encoding picture element to be encoded in the selected specific encoding mode.
The second main encoding step may comprise:
a second predicting step of calculating a prediction value of the encoding picture element based on the value of the reference picture element;
a second prediction error calculating step of calculating an error between the value of the encoding picture element and the prediction value calculated by the second predicting step as a prediction error; and
a third encoding step of encoding the prediction error calculated by the second prediction error calculating step for the encoding picture element to be encoded in the selected encoding mode other than the specific encoding mode, regardless of whether the prediction error is the predetermined value, and outputting the codeword for the encoding picture element to be encoded in the selected encoding mode other than the specific encoding mode.
The first encoding step may comprise a first probability estimating step of receiving the result of the determination output by the determination step as a sequence of binary symbols and estimating an occurrence probability of one of the binary symbols and a first codeword allotting step of encoding the sequence of binary symbols,
the second encoding step may comprise a first error-to-symbol converting step of receiving the prediction error and converting the prediction error into a sequence of binary symbols, a second probability estimating step of receiving the sequence of binary symbols and estimating an occurrence probability of one of the binary symbols, and a second codeword allotting step of encoding the sequence of binary symbols, and
the third encoding step may comprise a second error-to-symbol converting step of receiving the prediction error and converting the prediction error into a sequence of binary symbols, a third probability estimating step of receiving the sequence of binary symbols and estimating an occurrence probability of one of the binary symbols, and a third codeword allotting step of encoding the sequence of binary symbols.
In the encoding method according to the present invention, at least one of the first codeword allotting step, the second codeword allotting step, and the third codeword allotting step may include a step of changing interpretation as to which one of the binary symbols is a more probable symbol based on a change in probability estimation for the binary symbols respectively implemented by the first probability estimating step for the first codeword allotting step, the second probability estimating step for the second codeword allotting step, and the third probability estimating step for the third codeword allotting step.
In the encoding method according to the present invention, based on information as to which one of the binary symbols is a more probable symbol and an estimated occurrence probability of the more probable symbol, at least one of the first codeword allotting step, the second codeword allotting step, and the third codeword allotting step may implement encoding for an enlarged information source of the binary symbols effected by selecting a code most suited to a state of the enlarged information source of the binary symbols assumed from the estimated occurrence probability of the more probable symbol from a Huffman code set prepared systematically for the enlarged information source of the binary symbols.
A decoding method according to the present invention may comprise:
an outputting step of storing decoded picture elements having values within a predetermined range, and outputting the value of one of the decoded picture elements adjacent to a decoding picture element as the value of a reference picture element;
a mode deciding step of selecting one of a specific decoding mode and a decoding mode other than the specific decoding mode from a plurality of predefined decoding modes for the decoding picture element based on the value of the reference picture element;
a first main decoding step of receiving a codeword, predicting a value of the decoding picture element, determining whether the prediction is correct, and decoding the codeword into the value of the decoding picture element based on a result of the determination;
a second main decoding step of receiving a codeword, predicting the value of the decoding picture element, and decoding the codeword into the value of the decoding picture element without determining whether the prediction is correct; and
a decoding controlling step of selectively operating the first main decoding step and the second main decoding step based on the specific decoding mode and the decoding mode other than the specific decoding mode selected by the mode deciding step.
The first main decoding step may comprise:
a first predicting step of calculating a prediction value of the decoding picture element based on the value of the reference picture element;
a first decoding step of decoding the codeword for the decoding picture element to be decoded in the selected specific decoding mode into a result of determination indicating whether a prediction error is a predetermined value;
a second decoding step of decoding the codeword for the decoding picture element to be decoded in the selected specific decoding mode and having the prediction error other than the predetermined value into the prediction error other than the predetermined value; and
a first decoding picture element calculating step of calculating the value of the decoding picture element based on the prediction value for the decoding picture element calculated by the first predicting step, the result of the determination, and the prediction error other than the predetermined value obtained by the second decoding step.
The second main decoding step may comprise:
a second predicting step of calculating a prediction value of the decoding picture element based on the value of the reference picture element;
a third decoding step of decoding the codeword for the decoding picture element to be decoded in the selected decoding mode other than the specific decoding mode into a prediction error regardless of whether the prediction error is the predetermined value; and
a second decoding picture element calculating step of calculating the value of the decoding picture element to be decoded in the selected decoding mode other than the specific decoding mode based on the prediction value calculated by the second predicting step and the prediction error calculated by the third decoding step.
The first decoding step may comprise a first symbol restoring step for receiving the codeword and decoding the codeword into a sequence of binary symbols and a first probability estimating step of estimating an occurrence probability of one of the binary symbols, and a step of outputting one of the binary symbols as a result of the determination,
the second decoding step may comprise a second symbol restoring step of receiving the codeword and decoding the codeword into a sequence of binary symbols, a second probability estimating step of estimating an occurrence probability of one of the binary symbols, and a first symbol-to-error converting step of receiving the sequence of binary symbols and converting the sequence of binary symbols into the prediction error, and
the third decoding step may comprise a third symbol restoring step of receiving the codeword and decoding the codeword into a sequence of binary symbols, a third probability estimating step of receiving the binary symbols and estimating an occurrence probability of one of the binary symbols, and a second symbol-to-error converting step of receiving the sequence of binary symbols and converting the sequence of binary symbols into the prediction error.
In the decoding method according to the present invention, at least one of the first symbol restoring step, the second symbol restoring step, and the third symbol restoring step may include a step of changing interpretation as to which one of the binary symbols is a more probable symbol based on a change in probability estimation for the binary symbols respectively implemented by the first probability estimating step for the first symbol restoring step, the second probability estimating step for the second symbol restoring step, and the third probability estimating step for the third symbol restoring step.
In the decoding method according to the present invention, based on information as to which one of the binary symbols is a more probable symbol and an estimated occurrence probability of the more probable symbol, at least one of the first symbol restoring step, the second symbol restoring step, and the third symbol restoring step may implement decoding for an enlarged information source of binary symbols effected by selecting a code most suited to a state of the enlarged information source of binary symbols assumed from the estimated occurrence probability of the more probable symbol from a Huffman code set prepared systematically for the enlarged information source of binary symbols.
The encoding apparatus may be provided in a semiconductor chip.
The encoding apparatus may be provided in a circuit board.
A picture encoding apparatus according to the present invention for receiving picture signals representing picture elements, encoding the picture elements represented by the picture signals into codes by using an encoding apparatus therein, and for outputting the codes to a subsequent processing apparatus, the encoding apparatus may comprise:
a picture element memory for receiving and storing a picture element having a value within a predetermined range as an encoding picture element, outputting the value of the encoding picture element, and for outputting a value of an encoded picture element adjacent to the encoding picture element as the value of a reference picture element;
a mode determinator for selecting one of a specific encoding mode and an encoding mode other than the specific encoding mode from a plurality of predefined encoding modes for the encoding picture element based on the value of the reference picture element;
a first encoding section for predicting the value of the encoding picture element, determining whether the prediction is correct, encoding the value of the encoding picture element based on a result of the determination, and for outputting a codeword for the encoding picture element;
a second encoding section for predicting the value of the encoding picture element, encoding the value of the encoding picture element without determining whether the prediction is correct, and for outputting a codeword for the encoding picture element; and
an encoding controller for selectively operating the first encoding section and the second encoding section based on one of the specific encoding mode and the encoding mode other than the specific encoding mode selected by the mode determinator.
The picture processing apparatus may be an electronic computer.
The picture processing apparatus may be a scanner.
The picture processing apparatus may be a facsimile machine.
The picture processing apparatus may be a display unit.
The picture processing apparatus may be a storage device.
The decoding apparatus may be provided in a semiconductor chip.
The decoding apparatus may be provided in a circuit board.
A picture processing apparatus according to the present invention for receiving a picture signal representing a code for a picture element, decoding the code into the value of the picture element by a decoding apparatus therein, and for outputting the picture element to a subsequent processing apparatus, the decoding apparatus may comprise:
a picture element memory for storing decoded picture elements having values within a predetermined range and outputting the value of one of the decoded picture elements adjacent to a decoding picture element as the value of a reference picture element;
a mode determinator for selecting one of a specific decoding mode and a decoding mode other than the specific decoding mode from a plurality of predefined decoding modes for the decoding picture element based on the value of the reference picture element;
a first decoding section for receiving a codeword, predicting a value of the decoding picture element, determining whether the prediction is correct, and for decoding the codeword into the value of the decoding picture element based on a result of the determination;
a second decoding section for receiving a codeword, predicting the value of the decoding picture element, and for decoding the codeword into the value of the decoding picture element without determining whether the prediction is correct; and
a decoding controller for selectively operating the first decoding section and the second decoding section based on the result of the determination made by the specific decoding mode and the decoding mode other than the specific decoding mode selected by the mode determinator.
The picture processing apparatus may be an electronic computer.
The picture processing apparatus may be a scanner.
The picture processing apparatus may be a facsimile machine.
The picture processing apparatus may be a printer.
The picture processing apparatus may be a display unit.
The picture processing apparatus may be a storage device.
The encoding apparatus according to the present invention may comprise:
a picture element memory for receiving and storing a picture element having a value within a predetermined range as an encoding picture element, outputting the value of the encoding picture elements and for outputting a value of an encoded picture element adjacent to the encoding picture element as the value of a reference picture element;
an encoding section for predicting the value of the encoding picture element, determining whether the prediction is correct, encoding the value of the encoding picture element based on a result of the determination, and for outputting a codeword for the encoding picture element; and
an encoding controller for operating the encoding section based on the result of the prediction made by the encoding section.
The encoding section may comprise:
a predictor for calculating a prediction value of the encoding picture element based on the value of the reference picture element;
a prediction error calculator for calculating an error between the value of the encoding picture element and the prediction value calculated by the predictor (3) as a prediction error;
a determinator for determining whether the prediction error calculated by the prediction error calculator is a specific value and for outputting a result of determination;
a first encoder for receiving the result of determination output from the determinator, encoding the result of determination, and for outputting the codeword; and
a second encoder for encoding the prediction error calculated by the prediction error calculator when the prediction error is other than the specific value for the encoding picture element to be encoded and for outputting the codeword for the encoding picture element to be encoded.
A decoding apparatus according to the present invention may comprise:
a picture element memory for storing decoded picture elements having values within a predetermined range and for outputting the value of one of the decoded picture elements adjacent to a decoding picture element as the value of a reference picture element;
a decoding section for receiving a codeword, predicting a value of the decoding picture element, determining whether the prediction is correct, and for decoding the codeword into the value of the decoding picture element based on a result of the determination; and
a decoding controller for operating the decoding section based on the result of the determination made by the decoding section.
The decoding section may comprise:
a predictor for calculating a prediction value for the decoding picture element based on the value of the reference picture element;
a first decoder for decoding the codeword into a result of determination whether a prediction error is a predetermined value;
a second decoder for decoding the codeword for the decoding picture element whose prediction error is not the predetermined value into the prediction error;
a decoding picture element calculator for calculating the value of the decoding picture element based on the prediction value calculated by the predictor, the result of the determination, and the prediction error obtained by the second decoder.
A picture processing apparatus according to the present invention may comprise:
a picture pick-up device for picking up a picture composed of a plurality of picture elements;
a picture compression circuit for compressing the picked-up picture; and
a memory for storing the compressed picture, and
the picture compression circuit may comprise an encoding apparatus comprising:
a picture element memory for receiving and storing a picture element having a value within a predetermined range as an encoding picture element, outputting the value of the encoding picture element, and for outputting a value of an encoded picture element adjacent to the encoding picture element as the value of a reference picture element;
a mode determinator for selecting one of a specific encoding mode and an encoding mode other than the specific encoding mode from a plurality of predefined encoding modes for the encoding picture element based on the value of the reference picture element;
a first encoding section for predicting the value of the encoding picture element, determining whether the prediction is correct, encoding the value of the encoding picture element based on a result of the determination, and for outputting a codeword for the encoding picture element;
a second encoding section for predicting the value of the encoding picture element, encoding the value of the encoding picture element without determining whether the prediction is correct, and for outputting a codeword for the encoding picture element; and
an encoding controller for selectively operating the first encoding section and the second encoding section based on one of the specific encoding mode and the encoding mode other than the specific encoding mode selected by the mode determinator.
A picture processing apparatus according to the present invention may comprise:
a picture pick-up device for picking up a picture composed of a plurality of picture elements;
a picture compression circuit for compressing the picked-up picture;
a memory for storing the compressed picture; and
a picture expansion circuit for expanding the stored picture, and
the picture expansion circuit may comprise a decoding apparatus comprising:
a picture element memory for storing decoded picture elements having values within a predetermined range, and outputting the value of one of the decoded picture elements adjacent to a decoding picture element as a value of a reference picture element;
a mode determinator for selecting one of a specific decoding mode and a decoding mode other than the specific decoding mode from a plurality of predefined decoding modes for the decoding picture element based on the value of the reference picture element;
a first decoding section for receiving a codeword, predicting a value of the decoding picture element, determining whether the prediction is correct, and for decoding the codeword into the value of the decoding picture element based on a result of the determination;
a second decoding section for receiving a codeword for the decoding picture element, predicting the value of the decoding picture element, decoding the codeword into the value of the decoding picture element without determining whether the prediction is correct; and
a decoding controller for selectively operating the first decoding section and the second decoding section based on one of the specific decoding mode and the decoding mode other than the specific decoding mode selected by the mode determinator.
The picture compression circuit may comprise a plurality of the encoding apparatuses for inputting a luminance signal Y and color-difference signals U, V in parallel and for encoding the signals.
The picture compression circuit may comprise a plurality of the encoding apparatuses for inputting color signals R, G, B in parallel and for encoding the signals.
The picture compression circuit may comprise one encoding apparatus for serially inputting a luminance signal Y and color-difference signals U, V by a block unit and for encoding the signals.
The picture compression circuit may comprise one encoding apparatus for serially inputting color signals R, G, B by a block unit and for encoding the signals.
The picture expansion circuit may comprise a plurality of the decoding apparatuses for inputting an encoded luminance signal Y and encoded color-difference signals U, V in parallel and for decoding the signals.
The picture expansion circuit may comprise a plurality of the decoding apparatuses for inputting encoded color signals R, G, B in parallel and for decoding the signals.
The picture expansion circuit may comprise one decoding apparatus for serially inputting an encoded luminance signal Y and encoded color-difference signals U, V by a block unit and for decoding the signals.
The picture expansion circuit may comprise one decoding apparatus for serially inputting encoded color signals R, G, B by a block unit and for decoding the signals.
Further scope of applicability of the present invention will become apparent from the detailed description given hereinafter. However, it should be understood that the detailed description and specific examples, while indicating preferred embodiments of the invention, are given by way of illustration only, since various changes and modifications within the spirit and scope of the invention will become apparent to those skilled in the art from this detailed description.